# -*- coding:utf-8 -*-

from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from aircos.tools import views_tools
from django.http import HttpResponseNotFound,HttpResponseServerError


def get_count(request):

    data={
        "count":1
    }
    print "get_count"
    return views_tools.success_json(data)


def get_list(request):

    data=[
        {
            "id":"wd",
            "user_id":"ddddddddddddddddddddd",
            "platform_id":"abc",
            "platform_name":"京东"
        },
        # {
        #     "id": "tb",
        #     "platform_id": "def",
        #     "platform_name": "淘宝"
        # },
        # {
        #     "id": "tm",
        #     "platform_id": "xyz",
        #     "platform_name": "天猫"
        # }
]

    print "get_list"
    return views_tools.success_json(data)


def get(request):

    data={
            "id":"wd",
            "user_id":"ddddddddddddddddddddd",
            "access_token": "d11b37d76f3f1ae4b1fcac2f68b1b73c00076714de",
            "app_key":"3939722",
            "is_auto_check":True,
            "platform_id":"wd",
            "platform_name":"微店",
            "last_get_order_at":"2017-08-30 00:00:00",
            "store_is_auto_check":True
        }
    print "get"
    return views_tools.success_json(data)

@csrf_exempt
def set_last_get_order_at(request):
    id = request.POST["id"]
    name = request.POST["id"]
    data = {

    }
    print "set_last_get_order_at"
    print (id,name)

    return views_tools.success_json(data)

